﻿#region Using Directives

    using System;
 
    using Csla;

    using MarketPulse.BusinessLogic.Core;
    using MarketPulse.BusinessLogic.Common.Criteria;

#endregion

namespace MarketPulse.BusinessLogic.Common
{
    /// <summary>
    /// This class represents a read only collection of read only visits that are made by a mystery shopper or exit 
    /// interviewer (for eaxmple) when conducting either a mystery shop or exit interview or other 
    /// survey. 
    /// </summary>
    [Serializable]
    [Csla.Server.ObjectFactory("MarketPulse.DataAccess.Factory.VisitFactory, MarketPulse.DataAccess.Factory", "FetchInfoList")]
    public class VisitInfoList : MarketPulseReadOnlyListBase<VisitInfoList, VisitInfo>
    {      

        #region Constructors

            /// <summary>
            /// default constructor is private in order to (try to) enforce construction
            /// only via the static factory methods provided.
            /// </summary>
            private VisitInfoList()
            {
            }

        #endregion

        #region Methods

            #region Factory Methods

                ///// <summary>
                ///// Method used to get a list of read only visits that are associated with a particular Round (via the DataPortal client proxy)
                ///// </summary>
                ///// <param name="roundGuid">The Round Guid used to retrieve the visit list</param>
                ///// <returns>The populated list of visits</returns>
                //public static VisitInfoList GetByRoundGUID(Guid roundGuid)
                //{
                //    return DataPortal.Fetch<VisitInfoList>(new VisitCriteria(null, roundGuid, null, null));
                //}

                ///// <summary>
                ///// Method used to get a list of read only visits that are associated with a particular Branch (via the DataPortal client proxy)
                ///// </summary>
                ///// <param name="branchGuid">The Branch Guid used to retrieve the visit list</param>
                ///// <returns>The populated list of visits</returns>
                //public static VisitInfoList GetByBranchGUID(Guid branchGuid)
                //{
                //    return DataPortal.Fetch<VisitInfoList>(new VisitCriteria(null, null, branchGuid, null));
                //}

                /// <summary>
                /// Method used to get a list of read only visits that are associated with a particular User (via the DataPortal client proxy)
                /// </summary>
                /// <param name="userGuid">The user Guid used to retrieve the visit list</param>
                /// <returns>The populated list of visits</returns>
                public static VisitInfoList GetByUserGUID(Guid userGuid)
                {
                    return DataPortal.Fetch<VisitInfoList>(new UserGUIDCriteria(userGuid));
                }

                ///// <summary>
                ///// Method used to get a list of read only visits that are associated with a particular Profile and Company (via the DataPortal client proxy)
                ///// </summary>
                ///// <param name="profileGuid">The Profile Guid used to retrieve the visit list</param>
                ///// /// <param name="companyGuid">The Company Guid used to retrieve the visit list</param>
                ///// <returns>The populated list of visits</returns>
                //public static VisitInfoList GetByProfileGUIDAndCompanyGUID(Guid profileGuid, Guid companyGuid)
                //{
                //    return DataPortal.Fetch<VisitInfoList>(new ProfileGUIDAndCompanyGUIDCriteria(profileGuid, companyGuid));
                //}

                /// <summary>
                /// Method used to get a read only list of read only Visits that are associated with a particular Client (via the DataPortal client proxy)
                /// </summary>
                /// <param name="clientGUID">The Guid of the Client to use to retrieve the list</param>
                /// <param name="profileGUID">The Guid of the Profile to use to retrieve the list</param>
                /// <param name="startDateTime">The Start Time to use to retrieve the list</param>
                /// <param name="endDateTime">The End Time to use to retrieve the list</param>
                /// <returns>A valid (populated) list of read only Visits</returns>
                public static VisitInfoList GetByClientGUIDAndProfileGUIDAndDateRange(Guid clientGUID, Guid profileGUID, DateTime startDateTime, DateTime endDateTime)
                {
                    return DataPortal.Fetch<VisitInfoList>(new ClientGUIDAndProfileGUIDAndDateRangeCriteria(clientGUID, profileGUID, startDateTime, endDateTime));
                }

            #endregion

        #endregion     

    }
}
